<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>restful风格的URL设计原则</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/ehome/static/css/layui.css" media="all">

    <!--layui的js部分-->
    <script src="/ehome/static/layui.js"></script>

    <style>
        body{
            background-color: lightgray;
        }
        h2{
            text-align: center;
            margin:30px auto;
            color:darkgray;
            line-height: 60px;
        }

        div.layadmin-user-login-main{
            width: 50%;
            margin: 0 auto;
            background-color: white;
        }
        .ehome-input{
            float:left;
            width:85%;
            margin-left: 20px;

        }
        .ehome-input-label{
            display: block;
            float:left;
            height: 36px;
            width: 30px;
            line-height: 36px;
            margin-left: -28px;
        }
    </style>
</head>
<body>

<div class="layadmin-user-login layadmin-user-display-show" id="LAY-user-login" style="width:600px;margin: 200px auto;">

    <div class="layadmin-user-login-main">
        <div class="layadmin-user-login-box layadmin-user-login-header">
            <h2>表单提交</h2>
        </div>

        <div class="layadmin-user-login-box layadmin-user-login-body layui-form">
            <!--用户名输入框部分-->
            <div class="layui-form-item">
                <input type="text" name="jobNumber" id="jobNumber" lay-verify="required" placeholder="工号" class="layui-input ehome-input" maxlength="20" value="GL001">
                <label class="layadmin-user-login-icon layui-icon layui-icon-username ehome-input-label" for="jobNumber" id="jobNumberLabel"></label>
            </div>
            <!--用户密码输入框部分-->
            <div class="layui-form-item">

                <input type="password" name="password" id="password" lay-verify="required" placeholder="密码" class="layui-input ehome-input"  maxlength="20" value="123456">
                <label class="layadmin-user-login-icon layui-icon layui-icon-password ehome-input-label" for="password"  id="passwordLabel"></label>
            </div>
            <div class="layui-form-item">
                <button id="logBtn" class="layui-btn layui-btn-fluid layui-btn-disabled" lay-submit
                        lay-filter="LAY-user-login-submit" disabled="disabled">登
                    入</button>
            </div>


        </div>
    </div>

</div>



<script>


  // layui引用模块操作
  layui.use(['form', 'jquery'], function(){
      $ = layui.$
              ,layer = layui.layer
              ,form = layui.form
              ,router = layui.router()
              ,search = router.search;


      form.render();   // 执行表单渲染

      //表单提交事件
      form.on('submit(LAY-user-login-submit)', function(obj){

          // ajax提交
          $.ajax({
              url:"/ehome/sysUser2/"
            //  url:"/ehome/sysUser2/1"
            //  url:"/ehome/sysUser2/page/1/limit/10"
             // ,data:obj.field
              ,type:"get"
              ,dataType:"json"
              ,success:function (returnData){
                  layer.msg(returnData.msg)

              },error:function(e){
                  console.log(e)
              }
          })
      });

  });
</script>
</body>
</html>